package com.sansi.pencilbook.service;

import com.sansi.pencilbook.DO.Result;
import com.sansi.pencilbook.Enum.RelationEnum;
import com.sansi.pencilbook.entity.Book;
import org.springframework.data.redis.core.BoundKeyOperations;

import java.io.File;
import java.util.List;

/**
 * 功能说明: 书籍的服务接口
 *
 * @author lsy13
 */
public interface BookServer {

    public Result getBooksAll();

    public Result getBooksAll(int pageNum, int pageSize);

    public Result getRecommendBooks(int userId);

    //获得某一分类下的图书
    public Result getBooksByCategory(int categoryId);

    //分页获得分类后的图书
    public Result getBooksByCategory(int categoryId, int pageNum, int pageSize);

    //通过书名查询书籍
    public Result getBooksByName(String name);

    //分页获得相同书名的图书
    public Result getBooksByName(String name, int pageNum, int pageSize);

    //通过ISBN查询书籍
    public Result getBookByIsbn(String isbn);

    //通过作者查询书籍
    public Result getBooksByAuthor(String author);

    //分页获得作者的图书
    public Result getBooksByAuthor(String author, int pageNum, int pageSize);

    //通过出版社查询书籍
    public Result getBooksByPublisher(String publisher);

    //分页获得出版社的图书
    public Result getBooksByPublisher(String publisher, int pageNum, int pageSize);

    //获得某种关系的书籍
    public Result getBookByRelation(int userId, RelationEnum relationEnum);

    //获得分页后某种关系的书籍
    public Result getBookByRelation(int userId, RelationEnum relationEnum, int pageNum, int pageSize);

    //获得新书
    public Result getBooksByTime();

    //获得分页后的新书
    public Result getBooksByTime(int pageNum, int pageSize);

    public Result addBook(Book book);

    public Result addBooks(List<Book> books);

    public Result addBooksByExcel(File xlsFile);

    public Result modifyBook(Book book);

    public Result modifyBooks(List<Book> books);


}
